#include<iostream>
#include<string>
#include<thread>
#include <sys/types.h>
#include <unistd.h>
using namespace std;
int func(){
    cout<<"我是子线程"<<" pid:"<<getpid()<<endl;
  return 1;
}
int main(){
    thread t1(func);
    int cnt=5;
    while(cnt--){
        sleep(1);
        cout<<"我是主线"<<endl;
    }
    t1.join();

}